Skip to content

.NET: Forward A2A MessageSendParams.Configuration in the A2A adapter - #7365

Merged
SergeyMenshykh merged 1 commit into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh-a2a-config-forwarding
Jul 28, 2026
Merged

.NET: Forward A2A MessageSendParams.Configuration in the A2A adapter#7365
SergeyMenshykh merged 1 commit into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh-a2a-config-forwarding

Conversation

@SergeyMenshykh

@SergeyMenshykh SergeyMenshykh commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

RequestContext.Configuration (SendMessageConfiguration) is never read by the A2A hosting layer, so agent authors cannot see the caller's acceptedOutputModes, historyLength, etc. through AgentRunOptions.

Description & Review Guide

  • What are the major changes?A2AAgentHandler now stores the whole SendMessageConfiguration in AdditionalProperties["a2a.configuration"] via a shared CreateRunOptions helper used by all three handler paths.
  • What is the impact of these changes? — Agents can read the caller's configuration; AgentRunMode stays authoritative for AllowBackgroundResponses.
  • What do you want reviewers to focus on? — Whether one key for the whole object is the right granularity.

Related Issue

Closes #5869

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change.

The A2A hosting layer now forwards the caller-supplied
SendMessageConfiguration from RequestContext.Configuration into
AgentRunOptions.AdditionalProperties under the key
'a2a.configuration'. This covers all three handler paths:
non-streaming, streaming, and task continuation.

The server-configured AgentRunMode remains authoritative for
AllowBackgroundResponses — the caller's ReturnImmediately is
forwarded but does not override the server decision.

Closes microsoft#5869

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ee820de-3e34-493b-a19c-1db6bc04871d
Copilot AI review requested due to automatic review settings July 28, 2026 13:29
@agent-framework-automation agent-framework-automation Bot added the .NET Usage: [Issues, PRs], Target: .Net label Jul 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the .NET A2A hosting adapter to forward the caller-provided MessageSendParams.Configuration (SendMessageConfiguration) into AgentRunOptions.AdditionalProperties so hosted agents can observe request configuration through the normal RunAsync/RunStreamingAsync options path.

Changes:

  • Refactors A2A option construction into a single CreateRunOptions helper used by non-streaming, streaming, and continuation paths.
  • Forwards the full SendMessageConfiguration object under the "a2a.configuration" key in AgentRunOptions.AdditionalProperties.
  • Adds unit tests verifying configuration forwarding (including in streaming mode) and ensuring server run mode remains authoritative for background execution.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
dotnet/src/Microsoft.Agents.AI.Hosting.A2A/A2AAgentHandler.cs Centralizes AgentRunOptions creation and forwards SendMessageConfiguration via AdditionalProperties.
dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/A2AAgentHandlerTests.cs Adds coverage for configuration forwarding and run-mode authority behavior.

Comment thread dotnet/src/Microsoft.Agents.AI.Hosting.A2A/A2AAgentHandler.cs

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 5 | Confidence: 89% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by SergeyMenshykh's agents

@SergeyMenshykh SergeyMenshykh self-assigned this Jul 28, 2026
@SergeyMenshykh
SergeyMenshykh marked this pull request as ready for review July 28, 2026 14:23
@SergeyMenshykh SergeyMenshykh moved this to In Review in Agent Framework Jul 28, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 5 | Confidence: 88% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by SergeyMenshykh's agents

@SergeyMenshykh
SergeyMenshykh enabled auto-merge July 28, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feature]: Forward A2A MessageSendParams.Configuration in the A2A adapter

5 participants